﻿using System;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace Spacer {
    public class FighterMedium : Ship {
		public FighterMedium() {}

        public FighterMedium( SolarSys world ) : base(world) {
			if( this.GetType() == typeof(FighterMedium) ) Initialize();
        }

		public override void Initialize() {
			base.Initialize();

			DrawMode = DrawMode.Sprite;
            Sprite = Main.Sprites["FighterMedium"];
            DrawScale = new Vector2( 0.3f );
            DrawColor = new Color( 1f, 1f, 1f, 1f );

            PhysicsInit( 1f, MovementMode.Normal );
            Friction = 0.3f;
            AngularDamping = 3f;
            LinearDamping = 1f;

			Health = 1000f;
			MaxHealth = 1000f;

			FireRate = 0.18f;
            ProjectileType = typeof( Projectile );
			
            Fuel = 100000;
            MaxFuel = 100000;
			MovementForce = 12f;
			TurningForce = 3f;
			BoostMultiplier = 2f;
			
            Resources = 5000;
		}

		// ----------

		public override void DoFire() {
			if( Globals.GameTime - LastFireTime >= FireRate ) {
				if( !FirePosition )
					FireProjectile( ProjectileType, GetShootPos(new Vector2(0, -0.6f)) );
				else
					FireProjectile( ProjectileType, GetShootPos(new Vector2(0, 0.6f)) );

				FirePosition = !FirePosition;
				LastFireTime = Globals.GameTime;
			}
		}

		// ----------

		public bool FirePosition { get; set; }
    }
}
